Using Scripting Understanding scripting will give you a great set of new abilities and ways to use Snak. A script is a mini-program with variables and functions. An alias is one kind of a script, an entry in the Tools menu is another. An alias complements the built in commands and is used on equal terms. Introduction A simple example is the /j alias. If you look in the Alias preference panel you'll see that it is defined as "/join $0". /join is a built in command and can be used on the input line with a parameter, and so can /j. The $0 is a scripting variable, and will be explained later. For a more elaborate example, look in the Clicking preference panel and note that you can customize what happens when you double click on a user. The default command for a double click in the notify list is "ConsoleClick". ConsoleClick is an alias, which is defined as "/msg $E $0-". This looks cryptic, but remember that a /msg always takes two pieces of input : the nick and the message. When Snak interprets the alias it replaces $E with the currently selected nick, and $0- with the contents of the input line. Definition An Alias is a command or sequence of commands that you invoke by typing the alias name in the input line Aliases can be complex multi-line mini-programs or they can simply be used to abbreviate frequently used commands. For example the alias "/j $0" will be translated to "/join #channelname" if you type "/j #channelname" into the input field. The "$0" in the above is a "scripting variable" and it will be replaced by the corresponding argument from the input line. $0 will be replaced by the first argument, $1 will be replaced by the second argument and so on. To see what an alias can do, please open the Preferences window and go to the Alias panel. Snak comes with a list of pre-defined aliases that makes use of the scripting variables. One of the pre-defined aliases is the /j described above, and another, slightly more complex alias is /e. Double click on the line with the "e" alias to bring up an Edit alias dialog. /e is a two line alias where the first line is an action and the second line is a normal channel message. Snak queues the individual commands in multi-line aliases and sends then to the channel sequentially. So if you were to type "/e lasagne" into the input field, Snak would queue two messages. The first would be an action message " eats lasagne", and the second line would be a normal channel message "*BURP*". Apologies for my atrocious table manners . . . . In the Edit Alias window you can make changes and save them with OK. Scripting Variables Snak supports numerical variables $0 thru $9 The numerical variables can be used individually or in ranges: $n- gives argument n through the last argument $n-m gives arguments n through m $-m gives the first argument through m $. Nick of the last person to whom you sent a message $, Nick of the last person who sent you a message $: Nick of the last person who joined the channel $: Nick of the last person who sent a message to the channel $B Text of the last message you sent $C The name of the channel $E Nick of the first selected user in the userlist $F User and host information about the first selected user in the userlist $I Name of the channel you were last invited to join $N Your nick